<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>delay1</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="delay.html" title="delay" />
    <link rel="next" href="delayk.html" title="delayk" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">delay1</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="delay.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="delayk.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="delay1"></a>
      <div class="titlepage"></div>
      <a id="IndexDelay1" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">delay1</span>
        </h2>
        <p>delay1 — 
      Delays an input signal by one sample.
          </p>
      </div>
      <div class="refsect1">
        <a id="idp98151776"></a>
        <h2>Description</h2>
        <p>
      Delays an input signal by one sample.
   </p>
      </div>
      <div class="refsect1">
        <a id="idp98214512"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">ares <span class="command"><strong>delay1</strong></span> asig [, iskip]</pre>
      </div>
      <div class="refsect1">
        <a id="idp98216688"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>iskip</em></span> (optional, default=0) -- initial disposition of delay-loop data space (see <a class="link" href="reson.html" title="reson"><em class="citetitle">reson</em></a>). The default value is 0.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98219360"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>delay1</em></span> is a special form of delay that serves to delay the audio signal <span class="emphasis"><em>asig</em></span> by just one sample. It is thus functionally equivalent to the <a class="link" href="delay.html" title="delay"><em class="citetitle">delay</em></a> opcode but is more efficient in both time and space. This unit is particularly useful in the fabrication of generalized non-recursive filters.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98222544"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the delay and delay1 opcodes. It uses the file <a class="ulink" href="examples/delay1.csd" target="_top"><em class="citetitle">delay1.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp98224416"></a>
          <p class="title">
            <strong>Example 176. Example of the delay1 opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in    No messages</span>
-odac           -iadc     -d     <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o delay.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="comment">; Initialize the global variables.</span>
<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">kr</span> <span class="op">=</span> 4410
<span class="ohdr">ksmps</span> <span class="op">=</span> 10
<span class="ohdr">nchnls</span> <span class="op">=</span> 2

<span class="comment">; Instrument #1 -- Silence on one channel</span>
<span class="oblock">instr</span> 1
  <span class="comment">; Make a basic sound.</span>
  abeep <span class="opc">vco</span>    20000, 440, 1

  <span class="comment">; Delay the beep by 1 sample.</span>
  idlt  <span class="op">=</span>      1<span class="op">/</span><span class="ohdr">sr</span>
  adel  <span class="opc">delay</span>  abeep, idlt
  adel1 <span class="opc">delay1</span> abeep 

  <span class="comment">; Send the beep to the left speaker and</span>
  <span class="comment">; the difference in the delayes to the right speaker.</span>
        <span class="opc">outs</span>   abeep, adel<span class="op">-</span>adel1
<span class="oblock">endin</span>


<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="comment">; Table #1, a sine wave.</span>
<span class="stamnt">f</span> 1 0 16384 10 1

<span class="comment">; Play Instrument #1.</span>
<span class="stamnt">i</span> 1 0.0 1

<span class="stamnt">e</span>


<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98228704"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="delay.html" title="delay"><em class="citetitle">delay</em></a>,
      <a class="link" href="delayr.html" title="delayr"><em class="citetitle">delayr</em></a>,
      <a class="link" href="delayw.html" title="delayw"><em class="citetitle">delayw</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98232672"></a>
        <h2>Credits</h2>
        <p>Author: Barry Vercoe</p>
        <p>Example written by John ffitch.</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="delay.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="delayk.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">delay </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> delayk</td>
        </tr>
      </table>
    </div>
  </body>
</html>
